map

inline fun <B> map(f: (A) -> B): Outcome<E, B>(source)

Map safely transforms a value in the Outcome. It has no effect on Absent or Failure instances.

Present(1).map { it + 1 }     // Present(2)
Absent.map { it + 1 } // Absent
Failure("bad").map { it + 1 } // Failure("bad")